const path = require("path");
const fs = require("fs");
const process = require("child_process");
const envPath = path.resolve(__dirname, "..", ".env.production");
const envText = fs.readFileSync(envPath, "utf8");
const OUTPUTDIR = /VUE_APP_OUTPUTDIR='(.+)'\r/g.exec(envText)[1];
// 打开report.html
const relativePath = path.resolve(
  __dirname,
  ...`../${OUTPUTDIR}/report.html`.split("/")
);
process.exec(`start ${relativePath}`);
